package com.google.code.irouter.portal.client.dashboard.main.center.managers.library.browser.guide.editor.form;

import com.google.code.irouter.portal.client.dashboard.main.center.managers.library.browser.guide.editor.Form;
import com.google.code.irouter.portal.client.dashboard.main.center.managers.library.browser.guide.Editor;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.Ext;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;

public final class SaveListener extends ButtonListenerAdapter {
	public void onClick(Button button, EventObject e) {
		Form form = (Form) Ext.getCmp(Form.class.getName());
		if(form.getForm().isValid())
			((Editor) Ext.getCmp(Editor.class.getName())).save();
	}
}
